package org.pay.union.enums.debitcredit;

import lombok.Getter;
import org.pay.union.enums.DebitCredit;

import java.io.Serializable;

/**
 * 财付通借贷分离标识
 */
@Getter
public enum CftCreditEnum implements Serializable, DebitCredit {
    A3003(3003, "信用卡", "工行"),
    A3007(3007, "信用卡", "农行"),
    A3106(3106, "信用卡", "建行"),
    A3107(3107, "信用卡", "中行"),
    A3113(3113, "信用卡", "兴业"),
    A3110(3110, "信用卡", "平安"),
    A3108(3108, "信用卡", "光大"),
    A3109(3109, "信用卡", "广发"),
    A3115(3115, "信用卡", "中信"),
    A3119(3119, "信用卡", "民生"),
    A3205(3205, "信用卡", "上海"),
    A3117(3117, "信用卡", "浦发"),
    A4186(4186, "借记卡", "农行"),
    A2013(2013, "借记卡", "建行"),
    A2016(2016, "借记卡", "广发"),
    A2125(2125, "借记卡", "中信"),
    A2014(2014, "借记卡", "光大"),
    A2008(2008, "借记卡", "民生"),
    A2127(2127, "借记卡", "华润"),
    A2024(2024, "借记卡", "平安"),
    A2021(2021, "借记卡", "兴业"),
    A2147(2147, "借记卡", "上海"),
    ;

    private Integer code;
    private String type;
    private String bank;

    CftCreditEnum(Integer code, String type, String bank) {
        this.code = code;
        this.type = type;
        this.bank = bank;
    }

    public static CftCreditEnum codeOf(Integer code) {
        for (CftCreditEnum jd : CftCreditEnum.values()) {
            if (jd.getCode().equals(code)) {
                return jd;
            }
        }
        return null;
    }
}
